package com.example.openplaydemo;

import android.content.Context;
import android.opengl.GLSurfaceView;
import android.util.AttributeSet;
import android.view.SurfaceHolder;

public class RGBPlayer extends GLSurfaceView implements Runnable, SurfaceHolder.Callback {
    public RGBPlayer(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void run() {
        playSDCardVideo("/sdcard/test/test.mp4",getHolder().getSurface());
    }

    @Override
    public void surfaceCreated(SurfaceHolder holder) {

        new Thread(this).start();
    }

    @Override
    public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {

    }

    @Override
    public void surfaceDestroyed(SurfaceHolder holder) {

    }
    public native void playSDCardVideo(String path,Object surface);

    public native void InitView(Object surface);
}
